import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraMonitorPlanVO, cameraMonitorPlanForm, cameraMonitorPlanQuery } from '@/api/security/video-monitor/camera-monitor-plan/types';

/**
 * 查询监控预案列表
 * @param query
 * @returns {*}
 */

export const listcameraMonitorPlan = (query?: cameraMonitorPlanQuery): AxiosPromise<cameraMonitorPlanVO[]> => {
  return request({
    url: '/camera/camera-monitor-plan/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询监控预案详细
 * @param cameraMonitorPlanId
 */
export const getcameraMonitorPlan = (cameraMonitorPlanId: string | number): AxiosPromise<cameraMonitorPlanVO> => {
  return request({
    url: '/camera/camera-monitor-plan/' + cameraMonitorPlanId,
    method: 'get'
  });
};

/**
 * 新增监控预案
 * @param data
 */
export const addcameraMonitorPlan = (data: cameraMonitorPlanForm) => {
  return request({
    url: '/camera/camera-monitor-plan',
    method: 'post',
    data: data
  });
};

/**
 * 修改监控预案
 * @param data
 */
export const updatecameraMonitorPlan = (data: cameraMonitorPlanForm) => {
  return request({
    url: '/camera/camera-monitor-plan',
    method: 'put',
    data: data
  });
};

/**
 * 删除监控预案
 * @param cameraMonitorPlanId
 */
export const delcameraMonitorPlan = (cameraMonitorPlanId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/camera-monitor-plan/' + cameraMonitorPlanId,
    method: 'delete'
  });
};
